<?php 

//This takes in the client id from testlog.php (if the user has a client id)
//and passes as an argument to GetClientInfo.pl which will search through
//the text file client.txt, eventually returning all the client information back
//here.

/***********************************************************************************************/


function getClientInfo($clientID){
  // Define the parameters that will be used
  $foo0 = $clientID; 

  // Build the system command that will be called
  $cmd='./../perllib/GetClientInfo.pl '.EscapeShellArg($foo0);

  // Execute the shell command
  $returnval = exec($cmd, $outputInfo, $result); 

  //Get info
        $_SESSION["clientname"] = $outputInfo[0];
        $_SESSION["clientupload"] = $outputInfo[1];
        $_SESSION["clientdownload"] = $outputInfo[2];
        $_SESSION["clientbandwidth"] = $outputInfo[3];
        $_SESSION["clientdrivespace"] = $outputInfo[4];
        $_SESSION["clientquota"] = $outputInfo[5];

  if($_SESSION["clientname"] == "ErrorCode626") { print "Service temporarily unavailable."; }
	
	
  include("globalVar.php");
  $x = $_SESSION["clientupload"];
  $temp = str_replace("CLIENTUPLOADROOT",$CLIENTUPLOADROOT,$x);
  $_SESSION["clientupload"] = $temp;
  $x = $_SESSION["clientdownload"];
  $temp = str_replace("CLIENTDOWNLOADROOT",$CLIENTDOWNLOADROOT,$x);
  $_SESSION["clientdownload"] = $temp;
	
  //echo  $_SESSION["clientdownload"] ;
  //Return info
  //return $client;

}


?>
